package com.whq.thrift.api.kafka.thriftlog.db;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class ConsumeLog implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	private long time = 0l;
	private Date timestamp;

	private String host;
	private String invokedMethod;
	private String flowId;
	private String seq;
	private Integer seqNo;
	private String runMethod;
	private Long cost;
	private Integer result;
	private Date createtTime;

	public int getTableSeq() {
		int ret = 100;

		Date t = null;
		if (this.timestamp == null) {
			t = new Date();
		} else {
			t = timestamp;
		}
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(t);
		return ret + calendar.get(Calendar.DAY_OF_MONTH);
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
		this.timestamp = new Date(time);
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getFlowId() {
		return flowId;
	}

	public void setFlowId(String flowId) {
		this.flowId = flowId;
	}

	public String getSeq() {
		return seq;
	}

	public void setSeq(String seq) {
		this.seq = seq;
	}

	public Long getCost() {
		return cost;
	}

	public void setCost(Long cost) {
		this.cost = cost;
	}

	public Integer getResult() {
		return result;
	}

	public void setResult(Integer result) {
		this.result = result;
	}

	public Date getCreatetTime() {
		return createtTime;
	}

	public void setCreatetTime(Date createtTime) {
		this.createtTime = createtTime;
	}
	
	public String getInvokedMethod() {
		return invokedMethod;
	}

	public void setInvokedMethod(String invokedMethod) {
		this.invokedMethod = invokedMethod;
	}

	public Integer getSeqNo() {
		return seqNo;
	}

	public void setSeqNo(Integer seqNo) {
		this.seqNo = seqNo;
	}

	public String getRunMethod() {
		return runMethod;
	}

	public void setRunMethod(String runMethod) {
		this.runMethod = runMethod;
	}

	/**
	 * 获取所有的表的序号
	 * 
	 * @return
	 */
	public static List<Integer> getAllTableSeqList() {
		List<Integer> retList = new ArrayList<Integer>(0);
		for (int i = 101; i <= 131; i++) {
			retList.add(i);
		}
		return retList;
	}

}
